package org.phone.manager.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

/**
 * 连接Mysql，数据库为dailyreport，库中保存用户信息。
 * 
 * @author heye2
 *
 */
@Repository
public class MySQLDao implements HibernateService {

	@Autowired
	private SessionFactory sessionFactory;

	public MySQLDao() {
	}
	
	public MySQLDao(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}


	public Session getCurrentSession() {
		return sessionFactory.getCurrentSession();
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

}
